package com.ironman.analyze.core.compute.base;

import com.ironman.analyze.core.context.TrainingContext;
import com.ironman.common.entity.BaseData;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;
import java.util.function.BiConsumer;


@Slf4j
@Getter
public abstract class BaseEmptyComputer<T extends BaseData> {

    /**
     * 共享变量
     */
    private final TrainingContext trainingContext;

    public BaseEmptyComputer(TrainingContext trainingContext) {
        this.trainingContext = trainingContext;
    }

    public void windowData(T t, BiConsumer<Date, T> windowDataConsumer) {
        windowDataConsumer.accept(t.getTs(), t);
    }

}
